<?php
$result = null;
	if(isset($_POST['hotel_submit_deposit']) && $_POST['hotel_submit_deposit']!=null)
	{					
		foreach ($_POST as $key=>$value) 
		{
			if($value!="Update")
				update_option($key, $value);
			$result = "<p style='color:red;'>Update Success!</p>";
		}	
	}
	$from_list = db_type_room_list(); 
	//print_r($from_list);
?>
<?php
if($result)
	echo $result; 
?>
<form action="" method="post">
	<table style="width: 100%;">
		<tr>
			<td colspan="2"><h3>Setup Tour Deposit</h3></td>
		</tr>
		<tr>
			<td style="text-align: left; width: 15%;">	
				<b><i>Room Type</i></b>			
			</td>
			<td>		
				<b><i>Deposit (%) Ex: 5% =>5</i></b>													
			</td>			
		</tr>			
		<?php
		if($from_list)
		{				
			$step = 1;			
			foreach ($from_list as $key=>$value) 
			{
				$key+=1;
			?>
			<tr>
				<td><?php echo $value;?></td>
				<?php
				$giatri = "hotel_deposit_name_".$key; 
				?>
				<td><input name="hotel_deposit_name_<?php echo $key;?>" type="text" value="<?php echo get_option($giatri);?>"></td>				
			</tr>
			<?php
				$step++; 
			}
		} 
		?>	
		<tr>
			<td ></td>
			<td><input type="submit" name="hotel_submit_deposit" value="Update"></td>
		</tr>	
	</table>
</form>	